filechooserwidget: Plug a memory leak
authorTimm Bäder <mail@baedert.org>
Thu, 10 Sep 2020 03:32:47 +0000 (05:32 +0200)
committerTimm Bäder <mail@baedert.org>
Tue, 15 Sep 2020 03:21:54 +0000 (05:21 +0200)
g_list_store_append refs the file

gtk/gtkfilechooserwidget.c

index 4d24a7c79e0bfa69c261a371a7272a975ac25e2b..39d9001541aa16b63648c6f39b74221442902638 100644 (file)
@@ -5453,7 +5453,10 @@ gtk_file_chooser_widget_get_files (GtkFileChooser *chooser)
         return NULL;
 
       if (info.file_from_entry)
-        g_list_store_append (info.result, info.file_from_entry);
+        {
+          g_list_store_append (info.result, info.file_from_entry);
+          g_object_unref (info.file_from_entry);
+        }
       else if (!file_list_seen)
         goto file_list;
       else